package com.customer.dao;

import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import com.customer.model.BasicEntity;

public interface IBasicDao<T extends BasicEntity> {
	
	public T load(Integer id);
	
	public List<T> find(T t);

	public List<T> findByPage(T t, int pageSize, int pageIndex);

	public int count(T t);

	public List<T> find(DetachedCriteria detachedCriteria);

	public List<T> findByPage(DetachedCriteria detachedCriteria, int pageSize,
			int pageIndex);

	public int count(DetachedCriteria detachedCriteria);

	public void save(T t);
	
	public void saveBatch(Collection<T> t);

	public void update(T t);
	
	public void updateBatch(Collection<T> t);
	
	public void remove(Integer id);

	public void merge(T t);
	
    public void exceuteSqlBatch(final String sql);
}
